<%@page import="helpers.UrlHelper"%>
<%@page import="entities.SiteConfig"%>
<%
SiteConfig siteConfig = (SiteConfig) request.getAttribute("config");
String title = (String) request.getParameter("title");
String description = (String) request.getParameter("description");
String keywords = (String) request.getParameter("keywords");
String ogSiteName = (String) request.getParameter("ogsite_name");
String ogTitle = (String) request.getParameter("ogtitle"); 
String ogUrl = (String) request.getParameter("ogurl");
String ogImage = (String) request.getParameter("ogimage");
String ogDescription = (String) request.getParameter("ogdescription");

if (title == null && siteConfig != null)
	title = siteConfig.getTitle();

if (description == null && siteConfig != null)
	description = siteConfig.getMetaDescription();

if (keywords == null && siteConfig != null)
	keywords = siteConfig.getMetaKeywords();

if (ogSiteName == null && siteConfig != null)
	ogSiteName = siteConfig.getSiteName();

if (ogTitle == null && siteConfig != null)
	ogTitle = siteConfig.getTitle();

if (ogDescription == null && siteConfig != null)
	ogDescription = siteConfig.getMetaDescription();

if (ogUrl == null)
	ogUrl = UrlHelper.getServerUrl(request);

if (ogImage == null)
	ogImage = UrlHelper.getServerUrl(request) + "/images/logo.png";

%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="Content-Type" content="text/html; charset=<%=siteConfig.getHttpCharacterSet().toUpperCase()%>" />
	<meta name="description" content="<%=description.replaceAll("[\"\']+", "")%>" >
	<meta name="Keywords" content="<%=keywords.replaceAll("[\"\']+", "")%>" >
	<meta itemprop="name" content="<%=ogTitle.replaceAll("[\"\']+", "")%>" />    
	<meta itemprop="description" content="<%=ogDescription %>" />
	<meta property="og:site_name" content="<%=ogSiteName %>" >
	<meta property="og:title" content="<%=ogTitle.replaceAll("[\"\']+", "")%>" >
	<meta property="og:url" content="<%=ogUrl%>" >
	<meta property="og:image" content="<%=ogImage%>" >
	<meta property="og:description" content="<%=ogDescription %>" >
	<title><%=title%></title>
	
    <!-- Bootstrap -->
    <link href="/css/bootstrap.css" rel="stylesheet" media="screen">
    <link href="/css/style.css" rel="stylesheet" media="screen">
    <link href="/css/font-awesome.css" rel="stylesheet" media="screen">
    <script src="/js/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="/js/bootstrap.js" type="text/javascript"></script>
 </head>
<body>
<div class="top_bar"></div>
	<header>
		<div class="container">
			<div class="logo">
				<a href="/">
					<span class="logo_left">Check </span>
					<span class="logo_right">Web</span> <span class="logo_left">Safe </span>
				</a>
				<h1>Do you want to check website is safe?</h1>
			</div>
			
			<div class="main-nav">
				<ul>
					<li><a data-description="Homepage" href="/">Home</a></li>
					<li><a data-description="About Us" href="/about-us">About</a></li>
					<li><a data-description="Contact Us" href="/contact">Contact</a></li>
					<li><a data-description="Privacy Policy" href="/privacy">Privacy</a></li>
					<li><a data-description="Directory Domain" href="/directory/a">Directory</a></li>
				</ul>
			</div>
		</div>
	</header>
	
	<div id="search-form">
		<div class="container">
			<div class="row-fluid">
				<div class="span6">
					<!-- AddThis Button BEGIN -->				
					<div class="addthis_toolbox addthis_default_style ">
					<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
					<a class="addthis_button_tweet" tw:via="showdomain"></a>
				
					<a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
					<a class="addthis_counter addthis_pill_style"></a>
					</div>
		            <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4f4f217074402877"></script>
		            <!-- AddThis Button END -->
				</div>
				<div class="span6">
					<form action="/goto" class="form-inline text-right">
	                   <input type="text" placeholder="Enter a domain" name="q" class="span6">
	                   <button type="submit" class="btn btn-info">Search</button>
	               </form>
				</div>
			</div>
		</div>
	</div>
    
    <div id="main">
    	<div class="container">